import request from '@/utils/request'
// 获取角色列表
export const reqGetRoles = (page = 1, pagesize = 10) => request({
  method: 'get',
  url: '/sys/role',
  params: {
    page, // 页码
    pagesize // 每页条数
  }
})

// 删除角色
export const reqDeleteRoleById = id => request({
  method: 'delete',
  url: `/sys/role/${id}`
})

// 获取公司信息
export const reqGetCompanyInfo = id => request({
  method: 'get',
  url: `/company/${id}`
})
// 根据id获取角色详情
export function reqGetRoleDetail(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'get'
  })
}
// 为角色分配权限
export const reqUpdateRoleRight = (id, permIds) => request({
  method: 'put',
  url: '/sys/role/assignPrem',
  data: {
    id,
    permIds
  }
})
